package source.model.type;

import source.model.skill.*;

/**
 * For each Unit type defined in the enumeration, there will be values assigned.
 * Each value corresponds to an attribute of the Unit. The go in this order:
 * <ol>
 * <li> Offensive Damage
 * <li> Defensive Damage
 * <li> Armor value
 * <li> Max Health/Starting Health
 * <li> Unit Upkeep (??? what value represents this ???)
 * <li> View Distance
 * <li> Movement Rate
 * <li> Manpower required for production
 * <li> Ore required for production
 * <li> <code>RangedUnit Specific</code> Minimum Attack Range
 * <li> <code>RangedUnit Specific</code> Maximum Attack Range
 * <li> Picture (String used to access this UnitType's icon)
 * </ol>
 * <p>
 * This enumeration should assist in creating new units at a later date.
 * For now, it is just a shell.<p>
 * TODO Create enumeration types with values (refer to webpage)
 * 
 * @author Sean Larson
 *
 */

public enum UnitType{
	
	COLONIST	(0, 1, 5, 25, 1, 3, 1, 200, 999, 0, 0,"Colonist", new Skill[] {}),

	EXPLORER	(0, 1, 2, 15, 1, 2, 3, 50, 999, 0, 0,"Explorer", new Skill[] {new SkillObserve(4),
																		new SkillTrap(6),
																		new SkillRemoveTraps(6),
																		new SkillDetectTrap(7),
																		new SkillSneak(5)}),
	MELEE		(10, 5, 8, 40, 2, 2, 1, 150, 999, 0, 1, "Melee", new Skill[] {new SkillObserve(1)}),
	RANGED		(5, 3, 5, 30, 2, 4, 2, 150, 999, 1, 3, "Ranged", new Skill[] {new SkillRangedAttack(2, 8, 5),
																		new SkillObserve(2)}),
	ARMY		(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Army", new Skill[] {});

	private final int oDamage, dDamage, armor, health, upkeep, view, 
	mvRate, manpower, ore, minRange, maxRange;
	
	private final String name;
	private final EntityType eType = EntityType.UNIT;
	
	private Skill[] skillSet;
	
	UnitType ( int o, int d, int a, int h, int u, int v, int mvRate, int mp, int ore, int minRange, int maxRange, String name, Skill[] skillSet) {
		this.oDamage = o;
		this.dDamage = d;
		this.armor = a;
		this.health = h;
		this.upkeep = u;
		this.view = v;
		this.mvRate = mvRate;
		this.manpower = mp;
		this.ore = ore;
		this.minRange = minRange;
		this.maxRange = maxRange;
		this.name = name;
		this.skillSet = skillSet;
	}
	
	
	public int oDamage() 		{ return this.oDamage; 	}
	public int dDamage() 		{ return this.dDamage; 	}
	public int armor()	 		{ return this.armor;	}
	public int health()	 		{ return this.health;	}
	public int upkeep()	 		{ return this.upkeep;	}
	public int view()	 		{ return this.view;		}
	public int mvRate() 		{ return mvRate;		}
	public int manpower()		{ return this.manpower;	}
	public int ore()			{ return this.ore;		}
	public int minRange()		{ return this.minRange;	}
	public int maxRange()		{ return this.maxRange; }
	public String getName()		{ return this.name;		}
	public EntityType eType()	{ return this.eType;	}

	public Skill[] skillSet(){
		return this.skillSet;
	}
}
